//
//  Ltq_labelButton.m
//  UI03_homework
//
//  Created by Hanlingyu on 16/7/18.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "Ltq_labelButton.h"

@implementation Ltq_labelButton




- (instancetype)initWithFrame:(CGRect)frame title:( NSString * _Nullable )title titleColor:(nonnull UIColor *)titleColor addTarget:(nonnull id)target action:(nonnull SEL)clickAction{

    self = [super initWithFrame:frame];
    if (self) {
        self.userInteractionEnabled = YES;

        _title = title;
        _titleColor = titleColor;
        _target = target;
        _acton = clickAction;
        [self createView];
        
    }

    return self;
}


- (void)createView {
    
    

    

    self.text = self.title;
    self.textAlignment = 1;
    self.textColor = self.titleColor;
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self.target action:self.acton];
    [self addGestureRecognizer:tap];
    
    
}






/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
